﻿using DBModel.Entity;
using DBModel.EntityExtension;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using System.Configuration;

namespace DBModel.Context
{
    /// <summary>
    /// 数据库连接上下文(ef core)
    /// </summary>
    public partial class AppDBContext : DbContext
    {
        public AppDBContext(DbContextOptions<AppDBContext> options) : base(options)
        {
        }

        public virtual DbSet<BasicUserInfo> TbUser { get; set; }
        public virtual DbSet<BusinessOrderInfo> BusinessOrderInfo { get; set; }
        public virtual DbSet<BusinessOrderProduct> BusinessOrderProduct { get; set; }
        public virtual DbSet<BusinessProductInfo> BusinessProductInfo { get; set; }
        public virtual DbSet<BusinessProductInventory> BusinessProductInventory { get; set; }
        public virtual DbSet<PaymentBankInfo> PaymentBankInfo { get; set; }
        public virtual DbSet<PaymentOrderInfo> PaymentOrderInfo { get; set; }

        public virtual DbSet<VipInfo> VipInfo { get; set; }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            base.OnConfiguring(optionsBuilder);
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.RegisterBasicEntity();

            base.OnModelCreating(modelBuilder);
        }

    }
}